<?php

namespace App\Admin\Extensions;

use App\Models\SchoolInfo;
use Encore\Admin\Actions\RowAction;
use Illuminate\Database\Eloquent\Model;

class AuditRejectBtn extends RowAction
{
    public $name = '驳回';

    public function dialog()
    {
        $this->confirm('确定驳回？');
    }

    public function handle(Model $model)
    {
        $model->status = SchoolInfo::STATUS_REJECT;
        $model->save();
        return $this->response()->success('已驳回')->refresh();
    }

}